﻿using System;
using System.Collections.Generic;
using System.Text;

namespace System.Windows.Controls
{
    public static class FrameworkElementExtensions
    {
        /// <summary>
        /// 获取并拼接基于当前运行目录的路径
        /// </summary>
        /// <param name="fe"></param>
        /// <param name="args"></param>
        /// <returns></returns>
        public static string MapPath(this FrameworkElement fe, params string[] args)
        {
            List<string> list = new List<string>();
            list.Add(AppDomain.CurrentDomain.BaseDirectory);
            list.AddRange(args);

            return System.IO.Path.Combine(list.ToArray());
        }
    }
}
